package com.china.book;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * https://blog.csdn.net/tomoca/article/details/118678684
 * https://www.microsoft.com/zh-cn/download/details.aspx?id=48145
 * 
 * @author TR
 *
 */
public class TestNativeDemo {
	 
    // 声明本地方法
    public native String testJni(String arg);
 
    static {
    	/**
    	 * https://www.cnblogs.com/ylz8401/p/9605498.html
    	 */
    	System.out.println(System.getProperty("java.library.path"));
        // 加载DLL文件
        System.load("C:\\Users\\TR\\Documents\\Visual Studio 2008\\Projects\\jniTest\\Debug\\jniTest.dll");
    }
 
    public static void main(String args[]) throws Exception{
        TestNativeDemo ob = new TestNativeDemo();
        // 调用本地方法
        //String result = ob.testJni("Hello,Jni--"); // call a native method
        //System.out.println("jnidemo.testJni=" + result);
        
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date d = format.parse("2023-03-12 17:00:00");
        System.out.println(d.getTime());
        
        d = format.parse("2023-03-12 03:00:00");
        System.out.println(d.getTime());
        
        d = new Date(1678647600000L);
        System.out.println(format.format(d));
    }
}